return now;
}
-
-void update_dom_time(struct exec_domain *ed)
+static inline void __update_dom_time(struct exec_domain *ed)
{
struct domain *d = ed->domain;
shared_info_t *si = d->shared_info;
- unsigned long flags;
- if ( d->last_propagated_timestamp == full_tsc_irq )
- return;
-
- read_lock_irqsave(&time_lock, flags);
spin_lock(&d->time_lock);
- d->last_propagated_timestamp = full_tsc_irq;
-
si->time_version1++;
wmb();
si->time_version2++;
spin_unlock(&d->time_lock);
- read_unlock_irqrestore(&time_lock, flags);
-
- send_guest_virq(ed, VIRQ_TIMER);
}
+void update_dom_time(struct exec_domain *ed)
+{
+ unsigned long flags;
+
+ if ( ed->domain->shared_info->tsc_timestamp != full_tsc_irq )
+ {
+ read_lock_irqsave(&time_lock, flags);
+ __update_dom_time(ed);
+ read_unlock_irqrestore(&time_lock, flags);
+ send_guest_virq(ed, VIRQ_TIMER);
+ }
+}
/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
wc_sec = secs;
wc_usec = _usecs;
- write_unlock_irq(&time_lock);
-
/* Others will pick up the change at the next tick. */
- current->domain->last_propagated_timestamp = 0; /* force propagation */
- update_dom_time(current);
+ __update_dom_time(current);
+ send_guest_virq(current, VIRQ_TIMER);
+
+ write_unlock_irq(&time_lock);
}